#include "ot-admin-builtins.h"
#include "ot-admin-functions.h"
#include "ot-admin-deploy.h"
+#include "ostree-pull.h"
#include "ostree.h"
#include "otutil.h"
if (origin_remote)
{
+ char *refs_to_fetch[] = { origin_ref, NULL };
+
g_print ("Fetching remote %s ref %s\n", origin_remote, origin_ref);
- if (!ot_admin_pull (admin_opts->sysroot, origin_remote, origin_ref,
- cancellable, error))
+
+ if (!ostree_pull (repo, origin_remote, refs_to_fetch, OSTREE_PULL_FLAGS_NONE,
+ cancellable, error))
goto out;
}
return ret;
}
-gboolean
-ot_admin_pull (GFile *sysroot,
- const char *remote,
- const char *ref,
- GCancellable *cancellable,
- GError **error)
-{
- gs_unref_object GFile *repo_path = g_file_resolve_relative_path (sysroot, "ostree/repo");
- gs_free char *repo_arg = g_strconcat ("--repo=",
- gs_file_get_path_cached (repo_path),
- NULL);
-
- return gs_subprocess_simple_run_sync (NULL,
- GS_SUBPROCESS_STREAM_DISPOSITION_INHERIT,
- cancellable, error,
- "ostree", repo_arg, "pull", remote, ref, NULL);
-}
-
GFile *
ot_admin_get_deployment_directory (GFile *sysroot,
OtDeployment *deployment)
GKeyFile *ot_origin_new_from_refspec (const char *refspec);
-gboolean ot_admin_pull (GFile *ostree_dir,
- const char *remote,
- const char *ref,
- GCancellable *cancellable,
- GError **error);
-
G_END_DECLS
#endif